home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / gtksourceview-2.0 / language-specs / language2.rng < prev    next >
Encoding:
Extensible Markup Language  |  2010-08-16  |  13.3 KB  |  491 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4.  Copyright (C) 2005-2007 Marco Barisione <barisione@gmail.com>
  5.  Copyright (C) 2005-2007 Emanuele Aina
  6.  
  7.  This library is free software; you can redistribute it and/or
  8.  modify it under the terms of the GNU Library General Public
  9.  License as published by the Free Software Foundation; either
  10.  version 2 of the License, or (at your option) any later version.
  11.  
  12.  This library is distributed in the hope that it will be useful,
  13.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  Library General Public License for more details.
  16.  
  17.  You should have received a copy of the GNU Library General Public
  18.  License along with this library; if not, write to the
  19.  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20.  Boston, MA 02111-1307, USA.
  21.  
  22. -->
  23. <grammar xmlns="http://relaxng.org/ns/structure/1.0"
  24.          datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  25. <start>
  26.     <element name="language">
  27.         <choice>
  28.             <attribute name="name"/>
  29.             <attribute name="_name"/>
  30.         </choice>
  31.  
  32.         <attribute name="id">
  33.             <data type="string">
  34.                 <param name="pattern">([a-zA-Z0-9_]|-)+</param>
  35.             </data>
  36.         </attribute>
  37.  
  38.         <attribute name="version"/>
  39.  
  40.         <optional>
  41.             <choice>
  42.                 <attribute name="section"/>
  43.                 <attribute name="_section"/>
  44.             </choice>
  45.         </optional>
  46.  
  47.         <optional>
  48.             <attribute name="hidden">
  49.                 <ref name="boolean-value"/>
  50.             </attribute>
  51.         </optional>
  52.  
  53.         <optional>
  54.             <attribute name="translation-domain"/>
  55.         </optional>
  56.  
  57.         <optional>
  58.             <oneOrMore>
  59.                 <element name="author">
  60.                     <text/>
  61.                 </element>
  62.             </oneOrMore>        
  63.         </optional>
  64.     
  65.         <optional>
  66.             <ref name="metadata"/>
  67.         </optional>
  68.  
  69.         <optional>
  70.             <ref name="styles" />
  71.         </optional>
  72.  
  73.         <optional>
  74.             <element name="default-regex-options">
  75.                 <ref name="regex-options"/>
  76.             </element>
  77.         </optional>
  78.  
  79.         <optional>
  80.             <element name="keyword-char-class">
  81.                 <text/>
  82.             </element>
  83.         </optional>
  84.  
  85.         <ref name="definitions" />
  86.     </element>
  87. </start>
  88.  
  89.  
  90.  
  91. <define name="id-type">
  92.     <data type="string">
  93.         <!-- FIXME: Why it doesn't work?
  94.              It seems that [a-z-] is unsupported -->
  95.         <!--
  96.         <param name="pattern">([a-zA-Z0-9_-]+:)?[a-zA-Z0-9_-]+</param>
  97.         -->
  98.         <param name="pattern">(([a-zA-Z0-9_]|-)+:)?([a-zA-Z0-9_]|-)+</param>
  99.     </data>
  100. </define>
  101.  
  102. <define name="ref-type">
  103.     <data type="string">
  104.         <!-- FIXME: Why it doesn't work?
  105.              It seems that [a-z-] is unsupported -->
  106.         <!--
  107.         <param name="pattern">([a-zA-Z0-9_-]+:)?[a-zA-Z0-9_-]+(:\*)?</param>
  108.         -->
  109.         <param name="pattern">(([a-zA-Z0-9_]|-)+:)?([a-zA-Z0-9_]|-)+(:\*)?</param>
  110.     </data>
  111. </define>
  112.  
  113. <define name="boolean-value">
  114.     <choice>
  115.         <value>true</value>
  116.         <value>false</value>
  117.     </choice>
  118. </define>
  119.  
  120. <define name="regex-options">
  121.     <optional>
  122.         <attribute name="extended">
  123.             <ref name="boolean-value"/>
  124.         </attribute>
  125.     </optional>
  126.     <optional>
  127.         <attribute name="case-sensitive">
  128.             <ref name="boolean-value"/>
  129.         </attribute>
  130.     </optional>
  131.     <optional>
  132.         <attribute name="dupnames">
  133.             <ref name="boolean-value"/>
  134.         </attribute>
  135.     </optional>
  136. </define>
  137.  
  138.  
  139. <define name="property">
  140.     <element name="property">
  141.         <attribute name="name">
  142. <!--          <data type="string">-->
  143. <!--              <param name="pattern">([a-zA-Z0-9_]|-)+</param>-->
  144. <!--          </data>-->
  145.         </attribute>
  146.         <text/>
  147. <!--        <optional>
  148.             <attribute name="mimetypes"/>
  149.         </optional>-->
  150.     </element>
  151. </define>
  152.  
  153. <define name="metadata">
  154.     <element name="metadata">
  155.         <zeroOrMore>
  156.             <ref name="property"/>
  157.         </zeroOrMore>
  158.     </element>
  159. </define>
  160.  
  161. <define name="styles">
  162.     <element name="styles">
  163.         <oneOrMore>
  164.             <element name="style">
  165.                 <attribute name="id">
  166.                     <data type="string">
  167.                         <param name="pattern">([a-zA-Z0-9_]|-)+</param>
  168.                     </data>
  169.                 </attribute>
  170.                 <choice>
  171.                     <attribute name="name"/>
  172.                     <attribute name="_name"/>
  173.                 </choice>
  174.                 <optional>
  175.                     <attribute name="map-to">
  176.                         <ref name="id-type"/>
  177.                     </attribute>
  178.                 </optional>
  179.             </element>
  180.         </oneOrMore>
  181.     </element>
  182. </define>
  183.  
  184. <define name="definitions">
  185.     <element name="definitions">
  186.         <interleave>
  187.             <oneOrMore>
  188.                 <choice>
  189.                     <ref name="context-to-be-included"/>
  190.                     <ref name="context-container"/>
  191.                     <ref name="context-simple"/>
  192.                     <ref name="context-reference"/>
  193.                     <ref name="context-placeholder"/>
  194.                 </choice>
  195.             </oneOrMore>
  196.             <zeroOrMore>
  197.                 <ref name="define-regex"/>
  198.             </zeroOrMore>
  199.             <zeroOrMore>
  200.                 <ref name="replace-context"/>
  201.             </zeroOrMore>
  202.         </interleave>
  203.     </element>
  204. </define>
  205.  
  206.  
  207. <define name="context-simple">
  208.     <element name="context">
  209.         <optional>
  210.             <attribute name="id">
  211.                 <ref name="id-type"/>
  212.             </attribute>
  213.         </optional>
  214.         <optional>
  215.             <attribute name="style-ref">
  216.                 <ref name="id-type"/>
  217.             </attribute>
  218.         </optional>
  219.         <optional>
  220.             <attribute name="extend-parent">
  221.                 <ref name="boolean-value"/>
  222.             </attribute>
  223.         </optional>
  224.         <optional>
  225.             <attribute name="end-parent">
  226.                 <ref name="boolean-value"/>
  227.             </attribute>
  228.         </optional>
  229.         <optional>
  230.             <attribute name="first-line-only">
  231.                 <ref name="boolean-value"/>
  232.             </attribute>
  233.         </optional>
  234.         <optional>
  235.             <attribute name="once-only">
  236.                 <ref name="boolean-value"/>
  237.             </attribute>
  238.         </optional>
  239.         <optional>
  240.             <attribute name="class"/>
  241.         </optional>
  242.         <optional>
  243.             <attribute name="class-disabled"/>
  244.         </optional>
  245.         <choice>
  246.             <element name="match">
  247.                 <ref name="regex-options"/>
  248.                 <text/>
  249.             </element>
  250.  
  251.             <group>
  252.                 <optional>
  253.                     <element name="prefix"><text/></element>
  254.                 </optional>
  255.                 <optional>
  256.                     <element name="suffix"><text/></element>
  257.                 </optional>
  258.                 <oneOrMore>
  259.                     <element name="keyword"><text/></element>
  260.                 </oneOrMore>
  261.             </group>
  262.         </choice>
  263.  
  264.         <optional>
  265.             <element name="include">
  266.                 <oneOrMore>
  267.                     <ref name="context-subpattern-simple"/>
  268.                 </oneOrMore>
  269.             </element>
  270.         </optional>
  271.     </element>
  272. </define>
  273.  
  274. <define name="context-container">
  275.     <element name="context">
  276.         <optional>
  277.             <attribute name="id">
  278.                 <ref name="id-type"/>
  279.             </attribute>
  280.         </optional>
  281.         <optional>
  282.             <attribute name="style-ref">
  283.                 <ref name="id-type"/>
  284.             </attribute>
  285.         </optional>
  286.         <optional>
  287.             <attribute name="style-inside">
  288.                 <ref name="boolean-value"/>
  289.             </attribute>
  290.         </optional>
  291.         <optional>
  292.             <attribute name="extend-parent">
  293.                 <ref name="boolean-value"/>
  294.             </attribute>
  295.         </optional>
  296.         <optional>
  297.             <attribute name="end-parent">
  298.                 <ref name="boolean-value"/>
  299.             </attribute>
  300.         </optional>
  301.         <optional>
  302.             <attribute name="end-at-line-end">
  303.                 <ref name="boolean-value"/>
  304.             </attribute>
  305.         </optional>
  306.         <optional>
  307.             <attribute name="first-line-only">
  308.                 <ref name="boolean-value"/>
  309.             </attribute>
  310.         </optional>
  311.         <optional>
  312.             <attribute name="once-only">
  313.                 <ref name="boolean-value"/>
  314.             </attribute>
  315.         </optional>
  316.         <optional>
  317.             <attribute name="class"/>
  318.         </optional>
  319.         <optional>
  320.             <attribute name="class-disabled"/>
  321.         </optional>
  322.  
  323.         <element name="start">
  324.             <ref name="regex-options"/>
  325.             <text/>
  326.         </element>
  327.         <optional>
  328.             <element name="end">
  329.                 <ref name="regex-options"/>
  330.                 <text/>
  331.             </element>
  332.         </optional>
  333.  
  334.         <optional>
  335.             <element name="include">
  336.                 <interleave>
  337.                     <oneOrMore>
  338.                         <choice>
  339.                             <ref name="context-container"/>
  340.                             <ref name="context-simple"/>
  341.                             <ref name="context-to-be-included"/>
  342.                             <ref name="context-subpattern-container"/>
  343.                             <ref name="context-reference"/>
  344.                             <ref name="context-placeholder"/>
  345.                         </choice>
  346.                     </oneOrMore>
  347.                     <zeroOrMore>
  348.                         <ref name="define-regex"/>
  349.                     </zeroOrMore>
  350.                 </interleave>
  351.             </element>
  352.         </optional>
  353.     </element>
  354. </define>
  355.  
  356. <define name="context-to-be-included">
  357.     <element name="context">
  358.         <attribute name="id">
  359.             <ref name="id-type"/>
  360.         </attribute>
  361.         <optional>
  362.             <attribute name="class"/>
  363.         </optional>
  364.         <optional>
  365.             <attribute name="class-disabled"/>
  366.         </optional>
  367.  
  368.         <element name="include">
  369.             <interleave>
  370.                 <oneOrMore>
  371.                     <choice>
  372.                         <ref name="context-container"/>
  373.                         <ref name="context-simple"/>
  374.                         <ref name="context-to-be-included"/>
  375.                         <ref name="context-reference"/>
  376.                         <ref name="context-placeholder"/>
  377.                     </choice>
  378.                 </oneOrMore>
  379.                 <zeroOrMore>
  380.                     <ref name="define-regex"/>
  381.                 </zeroOrMore>
  382.             </interleave>
  383.         </element>
  384.     </element>
  385. </define>
  386.  
  387. <define name="context-subpattern-simple">
  388.     <element name="context">
  389.         <optional>
  390.             <attribute name="id">
  391.                 <ref name="id-type"/>
  392.             </attribute>
  393.         </optional>
  394.         <optional>
  395.             <attribute name="style-ref">
  396.                 <ref name="id-type"/>
  397.             </attribute>
  398.         </optional>
  399.         <optional>
  400.             <attribute name="class"/>
  401.         </optional>
  402.         <optional>
  403.             <attribute name="class-disabled"/>
  404.         </optional>
  405.  
  406.         <attribute name="sub-pattern"/>
  407.     </element>
  408. </define>
  409.  
  410. <define name="context-subpattern-container">
  411.     <element name="context">
  412.         <optional>
  413.             <attribute name="id">
  414.                 <ref name="id-type"/>
  415.             </attribute>
  416.         </optional>
  417.         <optional>
  418.             <attribute name="style-ref">
  419.                 <ref name="id-type"/>
  420.             </attribute>
  421.         </optional>
  422.         <optional>
  423.             <attribute name="class"/>
  424.         </optional>
  425.         <optional>
  426.             <attribute name="class-disabled"/>
  427.         </optional>
  428.  
  429.         <attribute name="sub-pattern"/>
  430.  
  431.         <attribute name="where">
  432.             <choice>
  433.                 <value>start</value>
  434.                 <value>end</value>
  435.             </choice>
  436.         </attribute>
  437.     </element>
  438. </define>
  439.  
  440. <define name="context-reference">
  441.     <element name="context">
  442.         <attribute name="ref">
  443.             <ref name="ref-type"/>
  444.         </attribute>
  445.         <optional>
  446.             <choice>
  447.                 <attribute name="style-ref">
  448.                     <ref name="id-type"/>
  449.                 </attribute>
  450.                 <attribute name="ignore-style">
  451.                     <ref name="boolean-value"/>
  452.                 </attribute>
  453.                 <attribute name="original">
  454.                     <ref name="boolean-value"/>
  455.                 </attribute>
  456.             </choice>
  457.         </optional>
  458.     </element>
  459. </define>
  460.  
  461. <define name="context-placeholder">
  462.     <element name="context">
  463.         <attribute name="id">
  464.             <ref name="id-type"/>
  465.         </attribute>
  466.     </element>
  467. </define>
  468.  
  469. <define name="define-regex">
  470.     <element name="define-regex">
  471.         <attribute name="id">
  472.             <ref name="id-type"/>
  473.         </attribute>
  474.         <ref name="regex-options"/>
  475.         <text/>
  476.     </element>
  477. </define>
  478.  
  479. <define name="replace-context">
  480.     <element name="replace">
  481.         <attribute name="id">
  482.             <ref name="ref-type"/>
  483.         </attribute>
  484.         <attribute name="ref">
  485.             <ref name="ref-type"/>
  486.         </attribute>
  487.     </element>
  488. </define>
  489.  
  490. </grammar>
  491.